# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgbase=libpanel
pkgname=(libpanel libpanel-docs)
pkgver=1.2.0
pkgrel=1
pkgdesc="Dock/panel library for GTK 4"
url="https://gitlab.gnome.org/GNOME/libpanel"
arch=(x86_64)
license=(LGPL)
depends=(
  gtk4
  libadwaita
)
makedepends=(
  gi-docgen
  git
  gobject-introspection
  meson
  vala
)
_commit=2757c49ed68507f38f14aca244eef5ec90ae00ee  # tags/1.2.0^0
source=("git+https://gitlab.gnome.org/GNOME/libpanel.git#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

build() {
  local meson_options=(
    -D install-examples=true
  )

  arch-meson $pkgname build "${meson_options[@]}"
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package_libpanel() {
  provides=(libpanel-1.so)

  meson install -C build --destdir "$pkgdir"

  mkdir -p doc/usr/share
  mv {"$pkgdir",doc}/usr/share/doc
}

package_libpanel-docs() {
  pkgdesc+=" (documentation)"
  depends=()

  mv doc/* "$pkgdir"
}

# vim:set sw=2 sts=-1 et:
